package com.cloudy.cloudspider.search;

import lombok.Builder;
import lombok.Data;

import java.util.Objects;

/**
 * Created by cloudy.xie on 18/1/12.
 */
@Builder
@Data
public class SearchNewsModel {
    //标题
    private String title;
    //标题图片
    private String titleImage;
    //时间
    private int time;
    //作者
    private String author;
    //作者头像
    private String authorIcon;
    //简介
    private String shortContext;
    //文章
    private String context;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitleImage() {
        return titleImage;
    }

    public void setTitleImage(String titleImage) {
        this.titleImage = titleImage;
    }

    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getAuthorIcon() {
        return authorIcon;
    }

    public void setAuthorIcon(String authorIcon) {
        this.authorIcon = authorIcon;
    }

    public String getShortContext() {
        return shortContext;
    }

    public void setShortContext(String shortContext) {
        this.shortContext = shortContext;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public boolean equals(Object obj) {
        return Objects.equals(this.getContext(), ((SearchNewsModel)obj).getContext());
    }

    public int hashCode(){
        return this.getContext().hashCode();
    }
}
